package com.rmb.entity;

import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
import com.rmb.common.model.Excel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @version 1.0
 * @author wan
 */
@Data
@Entity
@Table(name = "tb_task_info")
@AllArgsConstructor
@NoArgsConstructor
@ExcelTarget("taskInfo")
public class TaskInfo implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Excel(name = "编号")
    private Long id;

    /**
     * 任务名称
     */
    @Excel(name = "任务名称")
    private String name;

    /**
     * 任务权重级别
     */
    @Excel(name = "任务权重级别")
    @Column(name = "weight_level")
    private Integer weightLevel;

    /**
     * 总处理逻辑条数
     */
    @Excel(name = "总处理逻辑条数")
    @Column(name = "total")
    private Integer total;


    /**
     * 已处理逻辑条数
     */
    @Excel(name = "已处理逻辑条数")
    @Column(name = "process_total")
    private Integer processTotal;

    /**
     * 任务状态
     */
    @Excel(name = "任务状态")
    @Column(name = "status")
    private Integer status;

    /**
     * 错误条数
     */
    @Excel(name = "错误条数")
    @Column(name = "error_total")
    private Integer errorTotal;

    /**
     * 任务执行状态
     */
    @Excel(name = "任务执行状态")
    @Column(name = "exe_status")
    private Integer exeStatus;

    /**
     * 完任务成度
     */
    @Excel(name = "完任务成度")
    private Integer completeness;

    /**
     * 完成度(百分比)
     */
    @Excel(name = "完成度")
    @Column(name = "completeness_scale")
    private Double completenessScale;

    /**
     * 总需执行次数
     */
    @Excel(name = "总需执行次数")
    @Column(name = "execute_total")
    private Integer executeTotal;

    /**
     * 已完成执行次数
     */
    @Excel(name = "已完成执行次数")
    @Column(name = "complete_execute_total")
    private Integer completeExecuteTotal;

    /**
     * 预计完成时间 精确到秒
     */
    @Excel(name = "预计完成时间",width = 30.0)
    @Column(name = "complete_time")
    private Date completeTime;

    /**
     * 累计处理时间 精确到秒
     */
    @Excel(name = "累计处理时间")
    @Column(name = "grand_total_time")
    private Date grandTotalTime;

    /**
     * 乐观锁
     */
    @Excel(name = "乐观锁")
    private Integer revision;

    /**
     * 创建人
     */
    @Excel(name = "创建人")
    @Column(name = "create_by")
    private String createBy;

    /**
     * 更新人
     */
    @Excel(name = "更新人")
    @Column(name = "update_by")
    private String updateBy;

    /**
     * 创建时间
     */
    @Excel(name = "创建时间")
    @Column(name = "create_time")
    private Date createTime;


    /**
     * 修改时间
     */
    @Excel(name = "修改时间")
    @Column(name = "update_time")
    private Date updateTime;
}
